using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Win32;
using System.Windows.Forms;
namespace SSG {
	static class Settings {
		static readonly RegistryKey key=Registry.CurrentUser.OpenSubKey("software\\ssg");
		public static int Limit;
		public static string Keywords {
			get {
				return ((string)key.GetValue("Keywords"));
			}
		}
		public static string[] AllCsNames { get { return (string[])key.OpenSubKey("cs").GetValueNames(); } }
		public static string Timeout;
		public static string Hide;
		public static string ActiveCs;
		static Settings() {
			Limit=int.Parse((string)key.GetValue("Limit"));
			Timeout=(string)key.GetValue("Timeout");
			Hide=(string)key.GetValue("HideStr");
			ActiveCs=(string)key.GetValue("ActiveCs");
		}
		public static string ActiveConstrName {
			get { return ActiveCs; }
			set {
				using(RegistryKey key=Registry.CurrentUser.OpenSubKey("software\\ssg",true))
					key.SetValue("ActiveCs",value);
				ActiveCs=value;

			}
		}
		public static string ActiveConstr {
			get {
				string current=ActiveConstrName;
				if(current!=null)
					using(RegistryKey key=Registry.CurrentUser.OpenSubKey("software\\ssg\\cs",true))
						return key.GetValue(current) as string;
				return null;
			}
		}

	}
}
